import requests
from lxml import etree

url = "https://movie.douban.com/top250"

headers = {
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36'
}

response = requests.get(url=url, headers=headers)

# print(response.text)

html = etree.HTML(response.text)

list = html.xpath('//*[@id="content"]/div/div[1]/ol//span[@class="title"][1]/text()')

print(list)

for i in list:
    print(i)
